from BasePage import BasePage
from selenium.webdriver import ActionChains
import time
class HomePage(BasePage):
    _wo = (BasePage.ID, 'com.zoneyet.lovehottie:id/layout_me')
    _setup = (BasePage.ID, 'com.zoneyet.lovehottie:id/iv_edit')
    _Ph=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.TextView')
    _Ph1=(BasePage.ID,'com.zoneyet.lovehottie:id/zone_ucrop_complete')

    _qianming=(BasePage.ID,'com.zoneyet.lovehottie:id/et_info')
    _denglu = (BasePage.ID, 'com.zoneyet.lovehottie:id/layout_login')
    _zhanghaodenglu = (BasePage.ID, 'com.zoneyet.lovehottie:id/tv_login_pwd')
    _username = (BasePage.XPATH,
                 '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout[1]/android.widget.LinearLayout/android.widget.EditText')
    _password = (BasePage.XPATH,
                 '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.widget.LinearLayout[2]/android.widget.LinearLayout/android.widget.EditText')
    _loginButton = (BasePage.ID, "com.zoneyet.lovehottie:id/btn_login")
    _nickname=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_edit_des_nickname')
    _nickname1=(BasePage.ID,'com.zoneyet.lovehottie:id/randomcreate_bt')
    _quren=(BasePage.ID,'com.zoneyet.lovehottie:id/iv_other')
    _nickname2=(BasePage.ID,'com.zoneyet.lovehottie:id/nick_et')
    _country=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_edit_des_nationality')
    _country1=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.ListView/android.widget.LinearLayout[1]/android.widget.RelativeLayout')
    _occupation=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_edit_des_profession')
    _occupation1=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.TextView[1]')
    _occupation2=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.TextView[2]')
    _age=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_edit_des_age')
    _age1=(BasePage.ID,'com.zoneyet.lovehottie:id/age_textview')
    _q=(BasePage.ID,'com.zoneyet.lovehottie:id/btn_datetime_sure')
    _q1=(BasePage.ID,'com.zoneyet.lovehottie:id/iv_other')
    _height=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_edit_des_height')
    _height1=(BasePage.ID,'com.zoneyet.lovehottie:id/normal_edit')
    _weight=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_edit_des_weight')
    _weight1=(BasePage.ID,'com.zoneyet.lovehottie:id/normal_edit')
    _hobby=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.LinearLayout[9]/android.widget.TextView')
    _hobby1=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView[2]/android.widget.TextView[1]')
    #动态
    _dynamic=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[1]/android.widget.TextView')
    _zan=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.FrameLayout[2]/android.widget.TextView')
    _comment=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.FrameLayout[3]/android.widget.TextView')
    _comment1=(BasePage.ID,'com.zoneyet.lovehottie:id/et_add_reply')
    _comment2=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.ImageView')
    _dongtai=(BasePage.ID,'com.zoneyet.lovehottie:id/iv_right')
    _dongtai1=(BasePage.ID,'com.zoneyet.lovehottie:id/et_writemood_content')
    _position=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_get_location')
    _dongtai2=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_write_mood')
    _Photo=(BasePage.ID,'com.zoneyet.lovehottie:id/fl_add')
    _Photo1=(BasePage.ID,'com.zoneyet.lovehottie:id/pick_photo_button')
    _Photo2=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.FrameLayout/android.widget.ImageView')
    _Photo3=(BasePage.ID,'com.zoneyet.lovehottie:id/zonyet_tv_top_select_num')
    _Photo4=(BasePage.ID,'com.zoneyet.lovehottie:id/zoneyet_tv_send')
    _de=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.FrameLayout[1]/android.widget.ImageView')
    _de1=(BasePage.ID,'com.zoneyet.lovehottie:id/ok')
    #访客
    _f=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.TextView')
    _f1=(BasePage.ID,'com.zoneyet.lovehottie:id/left_image')
    _biaoqing=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.LinearLayout[3]/android.widget.TextView')
    _biaoqing1=(BasePage.ID,'com.zoneyet.lovehottie:id/iv_title_right')
    _biaoqing2=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[1]/android.widget.TextView[2]')
    _biaoqing3=(BasePage.ID,'com.zoneyet.lovehottie:id/left_image')
    _biaoqing4=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.appcompat.widget.LinearLayoutCompat/android.widget.LinearLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[1]/android.widget.TextView[2]')
    _biaoqing5=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_ok')

    _msg=(BasePage.ID,'com.zoneyet.lovehottie:id/tv_chat_new_msg')
    _small=(BasePage.ID,'com.zoneyet.lovehottie:id/iv_right_small')
    _frind=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.HorizontalScrollView/android.widget.LinearLayout/androidx.appcompat.app.ActionBar.Tab[3]/android.widget.TextView')
    _frindlist=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/android.widget.LinearLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout/android.widget.LinearLayout')
    _addfrind=(BasePage.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.ScrollView/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout[2]/android.widget.FrameLayout[1]/android.widget.ImageView')
    _list=(BasePage.ID,'com.zoneyet.lovehottie:id/iv_report')
    _defrind1=(BasePage.ID,'com.zoneyet.lovehottie:id/delete_friend')

    def getup_success(self,autograph,nickname,height,weight):
        #跳转编辑资料页面
        self.click(self._wo)
        time.sleep(1)
        self.click(self._setup)
        time.sleep(1)
        self.click(self._Ph)#上传照片
        self.click(self._Photo1)
        self.click(self._Photo2)
        self.click(self._Ph1)
        time.sleep(1)
        self.send_keys(self._qianming,autograph)#签名
        self.click(self._nickname)#昵称
        self.click(self._nickname1)#随机昵称
        self.click(self._quren)
        self.click(self._nickname)
        self.send_keys(self._nickname2,nickname)#自定义昵称
        self.click(self._quren)
        self.click(self._country)#国家
        self.click(self._country1)
        self.click(self._occupation)#职业
        self.click(self._occupation1)
        time.sleep(1)
        self.click(self._occupation2)
        self.click(self._quren)
        self.click(self._age)#年龄
        self.click(self._age1)#年龄
        self.click(self._q)
        self.click(self._q1)
        self.click(self._height)#身高
        time.sleep(1)
        self.send_keys(self._height1,height)
        self.click(self._q1)
        self.click(self._weight)#体重
        self.send_keys(self._weight1,weight)
        self.click(self._q1)
        self.click(self._hobby)#爱好
        self.click(self._hobby1)
        self.click(self._q1)
        time.sleep(2)
        self.click(self._q1)
    def dynamic_success(self,comment,dongt):
        #我的动态
        self.click(self._wo)
        time.sleep(1)
        self.click(self._dynamic)#点赞
        self.click(self._zan)
        self.click(self._comment)#评论
        self.send_keys(self._comment1,comment)
        self.click(self._comment2)
        time.sleep(2)
        self.click(self._dongtai)#发送动态
        self.send_keys(self._dongtai1,dongt)#编辑文字
        self.click(self._Photo)#选择照片
        self.click(self._Photo1)
        self.click(self._Photo2)
        self.click(self._Photo3)
        self.click(self._Photo4)
        self.click(self._position)#显示地址

        self.click(self._dongtai2)
        time.sleep(2)
        self.click(self._de)#删除动态
        self.click(self._de1)
    def visitor_success(self):
        #我的访客记录
        self.click(self._wo)
        self.click(self._f)
        time.sleep(1)
        #截图我的访客记录
        self.driver.get_screenshot_as_file("D:\selenium_img.png")
        self.click(self._f1)
        time.sleep(1)
        #个性装扮，购买表情、删除表情
        self.click(self._biaoqing)
        self.click(self._biaoqing1)
        self.click(self._biaoqing2)
        self.click(self._biaoqing5)
        self.click(self._biaoqing3)
        self.click(self._biaoqing4)
        time.sleep(2)
    def addfrind_success(self):
        #添加好友删除好友
        self.click(self._msg)
        self.click(self._small)
        self.click(self._frind)
        self.click(self._frindlist)
        self.click(self._addfrind)
        time.sleep(2)
        self.click(self._list)
        self.click(self._defrind1)































